<template>
  <div class="myOrder-wrap">
    <div class="order-tab">
      <ul>
        <li><router-link to="/orders" exact replace>苏鲜生订单</router-link></li>
        <li><router-link to="/orders/others" exact replace>其他订单</router-link></li>
      </ul>
    </div>

    <keep-alive>
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
import router from '@/router/index'

export default {
  beforeRouteLeave (to, from, next, redirect) {
			if(to.path.indexOf('cart2') > -1){
				next(false)
				router.push('/my')
			}else{
				next(true)
			}
	}
}
</script>

<style lang="scss" scoped>
@import "./style";
</style>